package com.wordpress.music2dot0.server;

import java.net.URL;
import java.util.TimerTask;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlID;

public class Song extends TimerTask {
	/**
	 * Group in which the song is currently playing. Null if song is not
	 * currently playing.
	 */
	private GroupServer group;

	@XmlElement
	@XmlID
	private String id;

	@XmlElement
	private String name;

	@XmlElement
	private URL url;

	@XmlElement
	private URL stream;

	@XmlElement
	private int duration;

	@XmlElement
	private String album_name;

	@XmlElement
	private String artist_name;

	@XmlElement
	private String tag_idstr;

	public String getAlbumName() {
		return this.album_name;
	}

	public String getArtistName() {
		return this.artist_name;
	}

	public int getDuration() {
		return this.duration;
	}

	public String getId() {
		return this.id;
	}

	public String getName() {
		return this.name;
	}

	public URL getStream() {
		return this.stream;
	}

	public String getTag_idstr() {
		return this.tag_idstr;
	}

	public URL getUrl() {
		return this.url;
	}

	@Override
	public void run() {
		this.group.playNext();
		this.group = null;
	}

	public void setGroup(GroupServer group) {
		this.group = group;
	}
}
